
echo off

SET CWD=%CD%

SET SVN=%ProgramFiles%\SlikSVN\bin\svn.exe
SET SVN_OPTS=--no-auth-cache

SET ZIP=%ProgramFiles%\7-Zip\7z.exe
SET ZIP_OPTS=-tzip
SET ZIP_OUTPUT=SourceDist.zip

SET DERM_SVN_URL=https://mostro/svn/Derm/trunk
SET DERM_SVN_DIR=SourceDist

rem Enter in the correct working directory (%1)
rem cd ..

rem Check out directory
"%SVN%" checkout "%DERM_SVN_URL%" "%DERM_SVN_DIR%" %SVN_OPTS% --revision HEAD --ignore-externals

rem Compress source distribution
del %ZIP_OUTPUT%
"%ZIP%" a %ZIP_OPTS% -xr!.svn* -scsWIN %ZIP_OUTPUT% "%DERM_SVN_DIR%\*"

rem Restore previous working directory
cd %CWD%